//引入redux
import {
    createStore,
    applyMiddleware
} from 'redux';

//引入reducer
import countReducer from './reducers/countReducer'

//异步处理中间件
//当我们要进行异步action，action是一个函数，我们dispacth的函数就会提交到中间件
//中间件帮我们执行函数，一般函数中会有一个dispatch再次派发到store中
import thunk from 'redux-thunk';

console.log('store调用了');
//创建store，并去创建reducer。(react引入applyMiddleware参数,是用来处理异步的中间件)
const store = createStore(countReducer,applyMiddleware(thunk));



//暴露
export default store